import Vue from 'vue';
import Router from 'vue-router';
/*代理商管理*/
import daili_shenhe from '../components/page/organizational/daili_manage/daili_ziliao/daili_shenhe.vue'
import daili_noshenhe from '../components/page/organizational/daili_manage/daili_ziliao/daili_noshenhe.vue'
import zhanghaojuese from '../components/page/organizational/daili_manage/daili_zhanghaojuese/index.vue'
import dengluzhanghao from '../components/page/organizational/daili_manage/daili_dengluzhanghao/index.vue'
/*集团管理*/
import jituan_shenhe from '../components/page/organizational/jituan_manage/jituan_ziliao/jituan_ziliao'
import jituan_noshenhe from '../components/page/organizational/jituan_manage/jituan_ziliao/jituan_ziliaono'
import jituan_zhjs from '../components/page/organizational/jituan_manage/jituan_zhanghaojuese/index'
import jituan_dlzh from '../components/page/organizational/jituan_manage/jituan_dengluzhanghao/index'
/*品牌管理*/
import pinpai_shenhe from '../components/page/organizational/pinpai_manage/pinpai_ziliao/pinpai_shenhe'
import pinpai_noshenhe from '../components/page/organizational/pinpai_manage/pinpai_ziliao/pinpai_noshenhe'
import pinpai_zhjs from '../components/page/organizational/pinpai_manage/pinpai_zhanghaojuese/index'
import pinpai_dlzh from '../components/page/organizational/pinpai_manage/pinpai_dengluzhanghao/index'
/*门店管理*/
import mendian_shenhe from '../components/page/organizational/mendian_manage/mendian_ziliao/mendian_shenhe'
import mendian_noshenhe from '../components/page/organizational/mendian_manage/mendian_ziliao/mendian_noshenhe'
import mendian_zhjs from '../components/page/organizational/mendian_manage/mendian_zhanghaojuese/index'
import mendian_dlzh from '../components/page/organizational/mendian_manage/mendian_dengluzhanghao/index'
/*基础设置*/
import zuzhicengji from '../components/page/organizational/jichu_manage/zuzhi_cengji/index'
import zuzhishenhe from '../components/page/organizational/jichu_manage/zuzhi_shenhe/index'
import mendianleixing from '../components/page/organizational/jichu_manage/mendian_leixing/index'
/*商品信息*/
import yuanliao from '../components/page/merchandise/shangpin_message/yuanliao/index'
import shangpin from '../components/page/merchandise/shangpin_message/shangpin/index'
Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/Dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                /*代理商管理*/
                {
                    path: '/daili_shenhe',
                    component: daili_shenhe,
                    meta: { title: '代理商资料', permission: true }
                },
                {
                    path: '/daili_noshenhe',
                    component: daili_noshenhe,
                    meta: { title: '代理商资料(不需要审核)', permission: true }
                },
                {
                    path: '/daili_zhanghaojuese',
                    component: zhanghaojuese,
                    meta: { title: '代理商账号角色', permission: true }
                },
                {
                    path: '/daili_dengluzhanghao',
                    component: dengluzhanghao,
                    meta: { title: '代理商登录账号', permission: true }
                },
                /*集团管理*/
                {
                    path: '/jituan_shenhe',
                    component: jituan_shenhe,
                    meta: { title: '集团资料', permission: true }
                },
                {
                    path: '/jituan_noshenhe',
                    component: jituan_noshenhe,
                    meta: { title: '集团资料(不需要审核)', permission: true }
                },
                {
                    path: '/jituan_zhjs',
                    component: jituan_zhjs,
                    meta: { title: '集团账号角色', permission: true }
                },
                {
                    path: '/jituan_dlzh',
                    component: jituan_dlzh,
                    meta: { title: '集团登录账号', permission: true }
                },
                /*品牌管理*/
                {
                    path: '/pinpai_shenhe',
                    component: pinpai_shenhe,
                    meta: { title: '品牌信息', permission: true }
                },
                {
                    path: '/pinpai_noshenhe',
                    component: pinpai_noshenhe,
                    meta: { title: '品牌信息(不需要审核)', permission: true }
                },
                {
                    path: '/pinpai_zhjs',
                    component: pinpai_zhjs,
                    meta: { title: '品牌账号角色', permission: true }
                },
                {
                    path: '/pinpai_dlzh',
                    component: pinpai_dlzh,
                    meta: { title: '品牌登录账号', permission: true }
                },
                /*门店管理*/
                {
                    path: '/mendian_shenhe',
                    component: mendian_shenhe,
                    meta: { title: '门店信息', permission: true }
                },
                {
                    path: '/mendian_noshenhe',
                    component: mendian_noshenhe,
                    meta: { title: '门店信息(不需要审核)', permission: true }
                },
                {
                    path: '/mendian_zhjs',
                    component: mendian_zhjs,
                    meta: { title: '门店账号角色', permission: true }
                },
                {
                    path: '/mendian_dlzh',
                    component: mendian_dlzh,
                    meta: { title: '门店登录账号', permission: true }
                },
                /*基础设置*/
                {
                    path: '/zuzhicengji',
                    component: zuzhicengji,
                    meta: { title: '组织层级设置', permission: true }
                },
                {
                    path: '/zuzhishenhe',
                    component: zuzhishenhe,
                    meta: { title: '组织审核设置', permission: true }
                },
                {
                    path: '/mendianleixing',
                    component: mendianleixing,
                    meta: { title: '门店类型维护', permission: true }
                },
                /*商品信息*/
                {
                    path: '/yuanliao',
                    component: yuanliao,
                    meta: { title: '原料信息', permission: true }
                },
                {
                    path: '/shangpin',
                    component: shangpin,
                    meta: { title: '商品信息', permission: true }
                },
                {
                    path: '/Dashboard',
                    component: resolve => require(['../components/page/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/table',
                    component: resolve => require(['../components/page/BaseTable.vue'], resolve),
                    meta: { title: '基础表格' }
                },
                {
                    path: '/tabs',
                    component: resolve => require(['../components/page/Tabs.vue'], resolve),
                    meta: { title: 'tab选项卡' }
                },
                {
                    path: '/form',
                    component: resolve => require(['../components/page/BaseForm.vue'], resolve),
                    meta: { title: '基本表单' }
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: resolve => require(['../components/page/VueEditor.vue'], resolve),
                    meta: { title: '富文本编辑器' }
                },
                {
                    // markdown组件
                    path: '/markdown',
                    component: resolve => require(['../components/page/Markdown.vue'], resolve),
                    meta: { title: 'markdown编辑器' }
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: resolve => require(['../components/page/Upload.vue'], resolve),
                    meta: { title: '文件上传' }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: resolve => require(['../components/page/BaseCharts.vue'], resolve),
                    meta: { title: 'schart图表' }
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: resolve => require(['../components/page/DragList.vue'], resolve),
                    meta: { title: '拖拽列表' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: resolve => require(['../components/page/Permission.vue'], resolve),
                    meta: { title: '权限测试', permission: true }
                }
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },
        {
            path: '/403',
            component: resolve => require(['../components/page/403.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
